<%@ page contentType="text/html;charset=UTF-8" %>
<%@include file="/WEB-INF/jsp/common/taglibs.jspf"%>
<es:contentHeader/>

<div class="page-content">
    <div class="row">
        <div class="col-xs-12 widget-container-col ui-sortable">
            <div class="widget-box widget-color-blue ui-sortable-handle">
                <div class="widget-header">
                    <h5 class="widget-title bigger lighter">
                        <i class="ace-icon fa fa-hand-o-right"></i> 查询
                    </h5>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding clearfix search_area">
                        <form id="searchForm" class="form-horizontal padding-vertical">
                            <div class="row">
                                <div class="form-group col-sm-6">
                                    <esform:label path="search.id_in" cssClass="col-sm-4 control-label">编号</esform:label>
                                    <div class="col-sm-8">
                                        <esform:input path="search.id_in" cssClass="form-control input-sm" placeholder="多个使用空格分隔"/>
                                    </div>
                                </div>
                                <div class="form-group col-sm-6">
                                    <esform:label path="search.name_like" cssClass="col-sm-4 control-label">名称</esform:label>
                                    <div class="col-sm-8">
                                        <esform:input path="search.name_like" cssClass="form-control input-sm" placeholder="模糊查询"/>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="widget-toolbox padding-8 clearfix">
                        <div class="col-sm-6 pull-left">
                            <div class="btn-group">
                                <shiro:hasPermission name="showcase:upload:create">
                                    <div class="btn-group" style="margin-right:1px">
                                        <a class="btn btn-success no-disabled dropdown-toggle" data-toggle="dropdown">
                                            <i class="ace-icon fa fa-plus"></i>新&nbsp;增<i class="caret"></i>
                                        </a>
                                        <ul class="dropdown-menu">
                                            <li><a class="btn-create">普通新增</a></li>
                                            <li><a id="ajaxCreate" href="${ctx}/showcase/upload/ajax/create">ajax新增</a></li>
                                            <li><a id="ajaxBatchCreate" href="${ctx}/ajaxUpload">ajax批量上传</a></li>
                                        </ul>
                                    </div>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="showcase:upload:update">
                                    <button type="button" class="btn btn-warning btn-update">
                                        <i class="ace-icon fa fa-pencil"></i>修&nbsp;改
                                    </button>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="showcase:upload:delete">
                                    <button type="button" class="btn btn-danger btn-delete">
                                        <i class="ace-icon fa fa-trash-o"></i>删除
                                    </button>
                                </shiro:hasPermission>
                            </div>
                        </div>
                        <div class="col-sm-6 pull-right text-right">
                            <button id="search" class="btn btn-xs">
                                <i class="ace-icon fa fa-search"></i>
                                <span class="bigger-110">查询</span>
                            </button>
                            <a id="clearSearch" class="btn btn-link btn-xs">清空</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 widget-container-col ui-sortable">
            <div class="widget-box widget-color-blue ui-sortable-handle">
                <div class="widget-header">
                    <h5 class="widget-title bigger lighter">
                        <i class="ace-icon fa fa-table"></i> 列表
                    </h5>
                    <div class="widget-toolbar">
                        <a id="refresh" class="white" data-tooltip title="刷新">
                            <i class="ace-icon fa fa-refresh bigger-120"></i>
                        </a>
                        <a id="fullscreen" class="orange2" data-tooltip title="全屏">
                            <i class="ace-icon fa fa-expand bigger-120"></i>
                        </a>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding table_area">
                        <table id="grid-table"></table>
                        <div id="grid-pager"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<es:contentFooter>
    <script>
        // 表格
        $('#grid-table').createGrid({
            url: ctx + '/showcase/upload/list',
            autoHeight: true,
            sortable: false,
            resizable: false,
            colModel:[
                {label: '编号', name: 'id', width: 60, fixed:true},
                {label: '名称', name: 'name', width: 100},
                {label: '附件', name: 'age', width: 150}
            ],
            pager : '#grid-pager'
        });
    </script>
</es:contentFooter>
